<template>
	<view class="payment" style="background-color: rgb(245,245,245);">
		<!-- <view class="items line1">
			<text class="lable">支付编号：</text><text class="lable">{{pay_sn}}</text>
		</view>
		<view class="line10"></view>
		<view class="items">
			<text class="lable">总价：</text><text class="price">￥{{moeny}} </text>
		</view>
		<view class="line10"></view> -->
		<view style="margin: 20rpx; background-color: #fff; border-radius: 12rpx;">
			<view class="items line1">
				<text class="lable">支付编号：</text><text class="lable bianhaoshuzi">{{pay_sn}}</text>
			</view>
			<view class="items">
				<text class="lable">总价：</text><text class="price">￥{{moeny}} </text>
			</view>
		</view>
		<!-- <view class="" style="padding-left: 20rpx;">
			我的预存款：<text class="yue">{{available_predeposit}}</text>
		</view>
		<view class="" style="padding-left: 20rpx;">
			充值卡余额：<text class="yue">{{available_rc_balance}}</text>
		</view>
		<view class="" style="padding-left: 20rpx;">
			可用信用额度：<text class="yue">{{credit_amount}}</text>
		</view> -->

		<!-- <view class="items line1">
			<text class="lable">在线支付：</text>
		</view>
		<view class="paly_list">
			<view class="flex0" v-for="(item,index) in payment_list" :key="index">
				<view class="rider360" @click="chenck(item.payment_code,item)">
					<image v-if="payment_code!=item.payment_code" class="rider360"
						src="@/static/images/address_check_no.png" mode=""></image>
					<image v-else class="rider360" src="@/static/images/checkyes.png" mode=""></image>
				</view>
				<image class="mag40 alipay" v-if="index!=0" src="@/static/images/payment/wxpay.png"></image>
				<image class="mag40 alipay" v-if="index==0" src="@/static/images/payment/alipay.png"></image>
				<view class="">{{item.payment_name}}</view>
			</view>	
		</view> -->
		<view style="background-color: #fff; margin: 20rpx; border-radius: 12rpx;">
			<view class="items line1">
				<text class="lable">在线支付：</text>
			</view>
			<view class="paly_list">
				<view v-for="(item,key,index) in payment_list" :key="index" @click="chenck(item)"
					style="padding-top: 10px;"
					:style="{paddingBottom:payment_count - 1 != index ? '5px' : '0',borderBottom: payment_count - 1 != index ? '1rpx solid rgb(245,245,245)' : '0rpx solid  #fff'}">
					<view class="flex0" style="display: flex; justify-content: space-between;">
						<view style="display: flex; justify-content: start; align-items: center;">
							<image class="mag40 alipay" :src="item.payment_image_m"></image>
							<view
								style="display: flex; flex-direction: column; justify-content: center; height: 72rpx;color: #000000;line-height: 16rpx; font-size: 30rpx;">
								<view style="font-size: 30rpx; line-height: 36rpx;">{{item.payment_name}}</view>
								<view v-if="item.payment_code == 'predeposit' || item.payment_code == 'rechargecard' "
									style="color: #999;font-size: 24rpx; line-height: 36rpx;">
									可用余额:{{item.amount}}
								</view>
							</view>

						</view>
						<view class="rider360">
							<!-- <image v-if="payment_code!=item.payment_code" class="rider360"
								src="@/static/images/address_check_no.png" mode=""></image> -->
							<view v-if="payment_code!==item.payment_code"
								style="border-radius: 50%; border: 1px solid #E5E5E5; width: 44rpx;height: 44rpx;">
							</view>
							<image v-else class="rider360" src="@/static/images/checkyes.png" mode=""></image>
						</view>
					</view>


					<view v-if="item.payment_code=='rechargecard'">
						<view class="card_box" v-for="(card,cardIndex) in item.payment_config" :key="cardIndex">
							<view class="card_head" @click="showOrCloseCardList(card, cardIndex, key)">
								<view class="card_head_text">
									<text style="font-size: 17px;">{{card.card_name}}</text>
									<text style="color: #999999;">
										可用余额
										<text
											style="color: #999999;font-weight: 800;margin-left: 5px;">￥{{card.available_amount}}</text>
									</text>
								</view>
								<view class="card_head_operate">
									<text style="color: #999;font-size: 13px;">展开</text>
									<image :style="{transform: card.isShow ? 'rotate(0deg)' : 'rotate(180deg)'}"
										style="width: 12px; height: 6px;margin-left: 3px;"
										src="../../static/images/down.png" mode=""></image>
								</view>
							</view>

							<view v-if="card.isShow">
								<view class="card_sub"
									:style="{opacity: (sub.isAllowSelect == null || sub.isAllowSelect) ? 1 : 0.2}"
									style="padding-top: 10px;" @click="selectOrNotCard(sub, cardIndex, key, subIndex)"
									:class="{card_item:subIndex != card.card_list.length - 1}"
									v-for="(sub,subIndex) in card.card_list" :key="subIndex">
									<view class="card_sub_title">
										<text>{{sub.sn}}</text>
										<text style="color: #999999;font-size: 13px;">有效期至：{{sub.used_expire_time}} 可用余额
											￥{{sub.available_amount}}</text>
									</view>
									<image style="width: 25px;height: 25px;"
										:src="sub.isSelect ? '../../static/images/card_select.png' : '../../static/images/card_select_n.png' ">
									</image>
								</view>
							</view>

						</view>
					</view>


				</view>
			</view>
		</view>
		<view class="bottom_btn"
			style="height: 152rpx; display: flex; justify-content: space-between; align-items: center; background-color: #fff;">
			<view style="text-align: right;padding-right: 20rpx;margin-bottom: 20rpx; margin-left: 30rpx;">总计：<texts
					style="font-size: 40rpx;color: #EB5327;">￥{{moeny}}</texts>
			</view>
			<view class="view2"
				style="margin-right: 30rpx; width: 300rpx; height: 88rpx;border-radius: 100rpx; text-align: center; line-height: 88rpx;"
				@click="pay()">确认支付</view>
		</view>
		<view class=""></view>
		<best-payment-password ref="payFlag" digits="6" @submit="checkPwd" @cancel="hide"></best-payment-password>
		<uni-popup ref='popup' type="center" :maskClick="false">
			<view class="quan">
				<view class="popup_title">恭喜获得10元优惠券</view>
				<button class="popup_btn">立即使用</button>
				<image @click="close()" class="colseImage" :src="`${picUrl}/store/del_pop.png`"
					style="height: 50rpx;width: 50rpx;"></image>
			</view>
		</uni-popup>
		<pay-keyboard :show_key="show_key" @hideFun="hideFun" @getPassword="getPassword"></pay-keyboard>
		<offline-payment ref="offlinePayment" :centent='offlinePaymentData'  :payment_code="payment_code"
			@offlinePaySubmit='offlinePaySubmit'></offline-payment>
	</view>
</template>

<script>
	import {
		globalData
	} from '../../globalData';
	import uniPopup from '@/components/uni-popup/uni-popup.vue'
	import payKeyboard from '@/plug/components/keyboard/keyboard.vue'
	const msdjs = require('@/common/api_sign/md5.js');
	import offlinePayment from "@/plug/pay/offline-payment/offline-payment.vue"
	export default {
		components: {
			payKeyboard,
			uniPopup,
			offlinePayment
		},
		data() {
			return {
				offlinePaymentData: '', //线下支付商家银行卡信息数据
				paymentData: { //线下支付要上传的数据
					remark: '',
					image: ''
				},
				pay_method: [],
				payment_code: '',
				pay_name1: '', //礼品卡
				pay_name2: '', //预存款
				pay_sn: '',
				moeny: '',
				eh_gift: '', //礼品卡余额
				available_predeposit: '', //预存款余额
				available_rc_balance: '', //充值卡余额
				credit_amount: '', //信用额度
				type: 0,
				order_sn: '',
				SpellGroup_sn: '',
				is_set_paypwd: 0,
				pay_tail: "",
				WeiXin: false,
				wxcode: "",
				show_key: false,
				activity_id: "",
				activity_type: "",
				payment_list: {},
				payment_count: 0,
				selectAllowed_merging: '', //多消费卡不能混用
			}
		},
		onLoad(e) {
			if (e.type) {
				this.type = e.type
			}
			if (e.SpellGroup_sn) {
				this.SpellGroup_sn = e.SpellGroup_sn
			}
			if (e.pay_tail || e.pay_tail == 0) {
				this.pay_tail = e.pay_tail
			}
			this.pay_sn = e.pay_sn

			// #ifdef MP-WEIXIN
			this.WeiXin = true;
			this.getcode();
			// #endif
			this.GetNifo();
			// this.getBalance()
		},
		onShow() {
			// this.is_pwd()
		},

		methods: {
			GetNifo() { //获取页面信息
				this.$util.request({
					url: '/mobile/index.php?act=member_payment&op=cayPage',
					method: 'POST',
					data: {
						pay_sn: this.pay_sn,
						pay_tail: this.pay_tail,
						type: this.type
					}
				}).then(res => {
					if (res.error_code == 0) {
						this.moeny = Number(res.datas.pay_amount_online).toFixed(2);
						this.available_predeposit = Number(res.datas.member_info.available_predeposit).toFixed(
							2); //预存款余额
						this.credit_amount = Number(res.datas.member_info.credit_amount).toFixed(
							2); //信用余额
						this.available_rc_balance = Number(res.datas.member_info.available_rc_balance).toFixed(
							2); //充值卡卡余额
						this.is_set_paypwd = res.datas.member_info.is_set_paypwd //用户是否设置密码
						this.payment_list = res.datas.payment_list //支付方式列表

						let allKeys = Object.keys(this.payment_list);
						this.payment_code = this.payment_list[allKeys[0]].payment_code

						// payment_count
						this.payment_count = allKeys.length

						this.order_sn = res.datas.order_sn
						this.activity_type = res.datas.activity_type //抽奖类型
						this.activity_id = res.datas.activity_id //抽奖id
                        let keys = Object.keys(this.payment_list);
						let firstKey = keys[0];
						this.chenck(this.payment_list[firstKey])
					} else {
						uni.showToast({
							title: res.message,
							icon: "none"
						})
					}
				})
			},
			getUrlParam(name) { //公众号截取code
				let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
				let r = window.location.search.substr(1).match(reg)
				if (r != null) {
					return unescape(r[2])
				}
				return null
			},
			getcode() { //小程序获取code
				let that = this
				uni.login({
					provider: 'weixin',
					success: function(loginRes) {
						that.wxcode = loginRes.code
					}
				});
			},
			showOrCloseCardList(card, cardIndex, groupKey) {
				this.$set(this.payment_list[groupKey].payment_config[cardIndex], "isShow", !(card.isShow || false))
			},
			selectOrNotCard(sub, cardIndex, groupKey, subIndex) {

				if (sub.isAllowSelect == false) {
					uni.showToast({
						title: '该卡和其他卡不能共用',
						icon: 'none'
					});
					return
				}
				let isSelect = !(sub.isSelect || false)

				let allowed_merging = isSelect ? sub.allowed_merging : ''

				//检查是否可以勾选	String	1

				let payment_config = this.payment_list[groupKey].payment_config
				this.$set(this.payment_list[groupKey].payment_config[cardIndex].card_list[subIndex], "isSelect", isSelect)

				//取消操作 寻找选择的状态
				if (allowed_merging.length == 0) {
					for (let i = 0; i < payment_config.length; i++) {
						let card_list = payment_config[i].card_list
						for (let j = 0; j < card_list.length; j++) {
							let card_allowed_merging = card_list[j].allowed_merging
							let isSelect = card_list[j].isSelect
							if (isSelect) {
								allowed_merging = card_allowed_merging;
								break;
							}
						}
					}
				}

				//isAllowSelect=true 的 听他的吩咐 其他的都不行
				for (let i = 0; i < payment_config.length; i++) {
					let card_list = payment_config[i].card_list
					for (let j = 0; j < card_list.length; j++) {
						let card_allowed_merging = card_list[j].allowed_merging
						//没有选中的 可以都选 或者某一个的可以选
						let allowClick = allowed_merging.length == 0 || card_allowed_merging == allowed_merging
						this.$set(this.payment_list[groupKey].payment_config[i].card_list[j], "isAllowSelect", allowClick)
					}
				}

				console.log(JSON.stringify(this.payment_list[groupKey].payment_config))

			},
			//是否是微信内置浏览器
			isWeiXin() {
				// #ifdef H5
				let ua = window.navigator.userAgent.toLowerCase();
				if (ua.match(/MicroMessenger/i) == 'micromessenger') {
					return true;
				} else {
					return false;
				}
				// #endif
			},
			//获取是否设置支付密码
			is_pwd() {
				this.$util.request({
					url: '/mobile/index.php?act=member_security&op=member',
					data: {}
				}).then(res => {
					this.is_set_paypwd = res.datas.is_set_paypwd
				})
			},

			//获取余额
			getBalance() {
				this.$util.request({
					url: '/mobile/index.php?act=member_index&op=getMemberBalance',
					data: {}
				}).then(res => {
					this.eh_gift = res.datas.balance_info.eh_gift
					this.available_predeposit = res.datas.balance_info.available_predeposit
				})
			},
			close() {
				this.$refs.popup.close()
			},
			hide() {
				this.$refs.payFlag.modalFun('hide')
			},
			//支付密码确认
			checkPwd(e) {},

			//选择支付方式
			chenck(items) {
				let payment_code = items.payment_code
				if (payment_code == 'predeposit') {
					if (this.available_predeposit == '0.00' || this.available_predeposit == '0') {
						uni.showToast({
							title: "预存款余额不足",
							icon: "none"
						})
						this.pay_name2 == ''
					} else {
						this.payment_code = payment_code
					}
				} else if (payment_code == 'rechargecard') {
					// if (this.available_rc_balance == '0.00' || this.available_rc_balance == '0') {
					// 	uni.showToast({
					// 		title: "充值卡余额不足",
					// 		icon: "none"
					// 	})
					// } else {
					this.payment_code = payment_code
					// }
				} else if (payment_code == 'credit') {
					if (this.credit_amount == '0.00' || this.credit_amount == '0') {
						uni.showToast({
							title: "可用信用额度不足",
							icon: "none"
						})
					} else {
						this.payment_code = payment_code
					}
				} else if (payment_code == 'transfer') {
					this.offlinePaymentData = items.payment_config.transfer_bankinfo.replace(/\r\n/g, "<br>");
					this.payment_code = payment_code
				} else if (payment_code == 'period') {
					
					this.offlinePaymentData = items.payment_config.period_bankinfo.replace(/\r\n/g, "<br>");
					this.payment_code = payment_code
					console.log(this.offlinePaymentData);
				} else {
					this.payment_code = payment_code
					console.log(111111111, this.payment_code)
				}
			},
			setpaypwd() { //去设置密码
				uni.navigateTo({
					url: '/member/security/SetPay?pay_sn=' + this.pay_sn
				})
			},
			showFun() {
				this.show_key = true
			},
			hideFun() {
				this.show_key = false
			},
			getPassword(n) {
				let that = this;
				uni.showLoading({})
                   

				let params = {
					pay_sn: this.pay_sn,
					password: n ? msdjs.hexMD5(n.password) : "", //支付密码
					gift: this.pay_name1 ? 1 : 0, //是否使用礼品卡
					pd: this.pay_name2 ? 1 : 0, //是否使用预存款
					payment_code: this.payment_code, //支付方式代号
					pay_tail: this.pay_tail, //是否支付尾款
					wx_code: this.wxcode, //微信code
					openid: uni.getStorageSync('openid') || "",
					transfer_image: this.paymentData.transfer_image, //线下支付图片
					transfer_remark: this.paymentData.transfer_remark, //线下支付备注
					type: this.type || ''
				}
				
				if (this.payment_code == 'rechargecard') {
					params['rechargecard_ids'] = this.selectAllowed_merging
				}
                console.log(params,'params111');

				this.$util.request({
					url: '/mobile/index.php?act=member_payment&op=pay',
					method: 'POST',
					data: params
				}).then(res => {
					uni.hideLoading()
					if (res.error_code != 0) {
						uni.showToast({
							title: res.message,
							icon: "none"
						})
					} else {
						if (res.datas.payment_code == "predeposit") {
							uni.showToast({
								title: '支付成功！',
								success() {
									that.navgetto();
								}
							})
						} else if (res.datas.payment_code == "transfer") {
							uni.showToast({
								title: '上传成功，等待平台审核！',
								icon: 'none',
								success() {
									that.navgetto();
								}
							})
						} else if (res.datas.payment_code == "period") {
							uni.showToast({
								title: '支付成功',
								icon: 'none',
								success() {
									that.navgetto();
								}
							})
						} else {
							that.TripartitePay(res);
						}
					}
				})

				that.password = n?.password
			},
			//发起支付
			pay() {
				if (this.payment_code == '') {
					uni.showToast({
						title: '请选择付款方式!',
						icon: 'none'
					})
					return false
				}


				if (this.payment_code == 'rechargecard') {
					//装载选中的消费卡
					this.selectAllowed_merging = '';
					let selectCardMoney = 0;
					let allValue = Object.values(this.payment_list)
					for (let i = 0; i < allValue.length; i++) {
						let item = allValue[i];
						if (item.payment_code == 'rechargecard') {
							let payment_config = item['payment_config']
							for (let j = 0; j < payment_config.length; j++) {
								let card_list = payment_config[j].card_list;
								for (let k = 0; k < card_list.length; k++) {
									let card = card_list[k];
									if (card.isSelect) {
										this.selectAllowed_merging += `${card.id},`
										selectCardMoney += card.available_amount
									}
								}
							}
							break;
						}
					}

					if (this.selectAllowed_merging.length == 0) {
						uni.showToast({
							title: '请选择消费卡',
							icon: 'none'
						});
						return
					}

					// moeny
					if (this.moeny > selectCardMoney) {
						uni.showToast({
							title: '余额不足',
							icon: 'none'
						});
						return
					}
					this.getPassword()
				} else if (this.payment_code == 'predeposit' || this.payment_code == 'payment_name') {
					if (this.is_set_paypwd == 0) {
						uni.showToast({
							title: '请先设置支付密码!',
							icon: 'none'
						})
						setTimeout(() => {
							this.setpaypwd()
						}, 1000)
						return false
					} else {
						this.showFun()
						// this.getPassword()
						// this.$refs.payFlag.modalFun('show')
					}
				} else if (this.payment_code == 'transfer') {
					this.$refs.offlinePayment.open()
				} else if (this.payment_code == 'period') {
					this.$refs.offlinePayment.open()
				}else {
					this.getPassword()
					// this.checkPwd()
				}
			},
			// 第三方支付
			TripartitePay(res) {
				console.log(res,'res11111111111');
				
				let that = this
				if (this.payment_code == 'alipay') {
					// #ifdef H5
					document.write(res.datas.html)
					// #endif
					// #ifdef APP-PLUS
					uni.requestPayment({
						provider: this.payment_code,
						orderInfo: res.datas.html,
						success: (e) => {
							uni.showToast({
								title: '支付成功！',
								success() {
									that.navgetto();
								}
							})
						},
						fail(res) {
							uni.showToast({
								title: '支付失败！',
								icon: 'none',
							});
						}
			
					})
					// #endif
				} else if (this.payment_code == 'wxpay') {
					//console.log('微信公众号支付2222222222222222222222222222222')
					// #ifdef H5
					//	console.log('微信公众号支付1111111111111111')
					//公众号微信支付
					let ua = window.navigator.userAgent.toLowerCase();
					if (ua.match(/MicroMessenger/i) == 'micromessenger') {
						var wx = require('jweixin-module')
						wx.config({
							appId: res.datas.html.appId,
							debug: false,
							timestamp: res.datas.html
								.timeStamp, // 支付签名时间戳，注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
							nonceStr: res.datas.html.nonceStr, // 支付签名随机串，不长于 32 位
							package: res.datas.html.package, // 统一支付接口返回的prepay_id参数值，提交格式如：prepay_id=\*\*\*）
							signType: res.datas.html.signType, // 签名方式，默认为'SHA1'，使用新版支付需传入'MD5'
							paySign: res.datas.html.paySign, // 支付签名
							jsApiList: ["scanQRCode", "chooseWXPay"] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
						});
			
						wx.ready(function() {
							wx.chooseWXPay({
								appId: res.datas.html.appId,
								timestamp: res.datas
									.html
									.timeStamp, // 支付签名时间戳，注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
								nonceStr: res.datas.html.nonceStr, // 支付签名随机串，不长于 32 位
								package: res.datas
									.html.package, // 统一支付接口返回的prepay_id参数值，提交格式如：prepay_id=\*\*\*）
								signType: res.datas.html.signType, // 签名方式，默认为'SHA1'，使用新版支付需传入'MD5'
								paySign: res.datas.html.paySign, // 支付签名
								success(res) {
									uni.showToast({
										title: "支付成功",
										icon: 'none',
										success() {
											that.navgetto();
										}
									});
									// that.wxcode=""
								},
								fail(res) {
									uni.showToast({
										title: "支付失败",
										icon: 'none',
									});
									// that.wxcode=""
								}
							});
						});
						wx.error(function(res) {
							console.log('err11111111111', res)
						});
			
					}
					// #endif
			
				} else if (this.payment_code == 'mini_wxpay') {
			
					// #ifdef MP-WEIXIN
					uni.requestPayment({
						provider: 'wxpay',
						timeStamp: res.datas.html.timeStamp + '',
						nonceStr: res.datas.html.nonceStr,
						package: res.datas.html.package,
						signType: res.datas.html.signType,
						paySign: res.datas.html.paySign,
						success: function(e) {
							uni.showToast({
								title: "支付成功",
								icon: 'none',
								success() {
									that.navgetto();
								}
							});
						},
						fail: function(err) {
							uni.showModal({
								content: "支付失败 ",
								showCancel: false,
							})
							console.log('fail:' + JSON.stringify(err));
						}
					});
					// #endif
				} else if (this.payment_code == 'app_wxpay') {
					// #ifdef APP-PLUS
					uni.requestPayment({
						provider: 'wxpay',
						orderInfo: JSON.stringify(res.datas.html),
						success(res) {
							console.log(111111112)
							uni.showToast({
								title: '支付成功！',
								success() {
									that.navgetto();
								}
							})
						},
						fail: (e) => {
							console.log(e)
							uni.showToast({
								title: "支付失败",
								icon: "none"
							})
						}
					})
					// #endif
				} else if (this.payment_code == "h5_wxpay") {
					if (res.datas?.html) {
						window.location.href = res.datas.html
					} else {
						uni.showToast({
							title: "暂未配置H5支付，请选择其他支付方式",
							icon: "none"
						})
					}
				} else if (this.payment_code == "rechargecard") {
					that.navgetto();
				}
			
				// else if (this.payment_code == "transfer") {
				// 	this.offlinePaymentData = res.datas.payment_info.payment_config.transfer_bankinfo.replace('\r\n','<br/>')
				// 	this.$refs.offlinePayment.open()
				// }
			},
			
			navgetto() {
				setTimeout(() => {
					if (this.type == 2) {
						if (this.SpellGroup_sn == '') {
							//发起拼团跳到拼团列表
							this.$util.request({
								url: '/mobile/index.php?act=spellGroup&op=get_spellgroup_info',
								method: 'get',
								data: {
									order_sn: this.order_sn
								}
							}).then(res => {
								if (res.error_code == 0) {
									uni.redirectTo({
										url: '/operation/spellGroup/info?SpellGroup_sn=' + res
											.datas
											.spellGroupInfo.SpellGroup_sn
									})
								} else {
									uni.showToast({
										title: res.message,
										icon: "none"
									})
								}
							})
						} else {
							//参与拼团，跳到拼团详情
							uni.redirectTo({
								url: '/operation/spellGroup/info?SpellGroup_sn=' + this.SpellGroup_sn
							})
						}
					} else if (this.type == 3) { //充值
						this.$store.commit('fnRecharge', 1)
						uni.navigateBack({
							delta: 1
						});
					} else if (this.activity_id && this.activity_id != 0 && this.pay_tail == 0) {
						if (this.activity_type == 1) { //大转盘
							uni.redirectTo({
								url: '/operation/prize/bigCircle?id=' + this.activity_id
							})
						} else if (this.activity_type == 2) { //九宫格
							uni.redirectTo({
								url: '/operation/prize/nineBoxs?id=' + this.activity_id
							})
						} else if (this.activity_type == 3) { //刮刮乐
							uni.redirectTo({
								url: '/operation/prize/squeegee?id=' + this.activity_id
							})
						}
					} else if (this.type == 'card') {
						//消费卡充值 支付成功返回到充值明细
						//通知界面跳转到
						globalData.pageShowValue = "rechargeSuccessJumpToList"
						uni.navigateBack();
					} else {
						//普通商品下单，跳到全部订单
						uni.redirectTo({
							url: '/member/order/AllOrder'
						})
					}
				}, 1500)
			},
			//线下支付弹窗确认返回数据
			offlinePaySubmit(evt) {
				this.paymentData = {
					transfer_image: evt.image,
					transfer_remark: evt.remark
				}
				this.getPassword()
			}
		},

		
	}
</script>

<style>
	.alipay {
		height: 36px;
		width: 36px;
	}

	.card_box {
		background-color: #F8F8F8;
		padding: 10px;
		margin-top: 8px;
		border-radius: 3px;
	}

	.card_head {
		display: flex;
		align-items: center;
	}

	.card_head_text {
		display: flex;
		flex-direction: column;
		flex-grow: 1;
	}

	.card_sub {
		display: flex;
		align-items: center;
	}

	.card_sub_title {
		display: flex;
		flex-direction: column;
		flex-grow: 1;
	}

	.card_item {
		border-bottom: 0.5px solid #DDDDDD;
		padding: 10px 0;
	}

	.yue {
		color: #FAA76D;
	}

	.yucunkuan {
		width: 48rpx;
		height: 50rpx;
		margin: 0px 46rpx;
	}

	.lipingka {
		height: 42rpx;
		width: 60rpx;
	}

	.pay_Image {
		/* width: 160rpx;
		height: 80rpx; */
		height: 50rpx;
		width: 60rpx;
	}

	.colseImage {
		height: 50rpx;
		width: 50rpx;
		position: absolute;
		bottom: -70rpx;
		left: 140rpx;
	}

	.popup_title {
		position: absolute;
		color: #FFFFFF;
		top: 25px;
		left: 22px;
	}

	.popup_btn {
		width: 200rpx;
		font-size: 26rpx;
		position: absolute;
		bottom: 20rpx;
		left: 70rpx;
		color: #FFFFFF;
		border-radius: 50rpx;
		background: linear-gradient(to right, #f33200, #f95a00);
	}

	.quan {
		position: relative;
		width: 337rpx;
		height: 377rpx;
		background-color: #FFFFFF;
		background: url(@/static/images/store/pay_quan.png) no-repeat;
		background-size: 337rpx 377rpx;
	}

	.bottom_btn {
		position: fixed;
		bottom: 0;
		width: 100%;
		right: 0rpx;
	}

	.bottom_btn .view2 {
		line-height: 100rpx;
		height: 100rpx;
		background-color: #ff4300;
		color: #FFFFFF;
		text-align: center;
		font-size: 30rpx;
	}

	.flex0 {
		margin-bottom: 20rpx;
	}

	.payment {
		background-color: #FFFFFF;
		border-top: 1rpx solid #F0F0F0;
	}

	.mag40 {
		margin: 0px 14rpx 0 0;
	}

	.payment .items {
		padding: 0px 20upx;
		height: 84upx;
		line-height: 84upx;
	}

	.payment .items .lable {
		font-size: 32upx;
		color: rgb(51, 51, 51);
	}

	.payment .items .lable.bianhaoshuzi {
		font-size: 30rpx;
		color: #999999;
	}

	.payment .items .price {

		font-size: 32upx;

		color: #EB5327;
		margin-left: 70rpx;
	}

	.paly_list {
		padding: 25upx;
		padding-top: 0;
	}

	.line10 {
		border-bottom: 10rpx solid #F0F0F0;
	}

	.line1 {
		border-top: 1rpx solid #F0F0F0;
	}

	.paly_list .rider360 {

		width: 50upx;
		height: 50upx;

	}
</style>